package com.dc.ai.controller;


import cn.hutool.crypto.SecureUtil;
import com.dc.ai.common.result.Result;
import com.dc.ai.entity.po.Product;
import com.dc.ai.security.utils.SecurityUtils;
import com.dc.ai.service.ProductService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;


@Slf4j
@Tag(name = "02.商品接口")
@RestController
@RequestMapping("/api/v1/product")
@RequiredArgsConstructor
public class ProductController {

    private final ProductService productService;


    @Operation(summary = "商品列表")
    @RequestMapping("/list")
    public Result<List<Product>> list() {
        //String userId = SecurityUtils.getUserId();
        String userId = "8f3044c1120f4a653c1be8fd21218a0a";
        return Result.success(productService.productListbyUserId(userId));
    }

}
